package com.xian.java.stream;

import com.google.common.collect.Lists;
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.common.functions.RichFlatMapFunction;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.scala.DataStream;
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment;
import org.apache.flink.util.Collector;

import java.util.Arrays;
import java.util.List;

/**
 * java 版 flink 流处理
 */
public class JavaFlinkStreamTest {
    public static void main(String[] args) {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        //ip, port, 分隔符, 重试次数
        DataStream<String> dataStream = env.socketTextStream("r71", 9999, '\n', 3);

//        dataStream.print();



        env.execute("JavaFlinkStreamTest");


    }
}
